package com.xiaoxing.salesclient.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xiaoxing.salesclient.mvp.ui.entity.KeChengXunXi;

import java.util.List;

import xiaoxing.com.salesclient.R;


public class KeChengXunXiAdapter extends BaseQuickAdapter<KeChengXunXi, BaseViewHolder> {

    private Context mContext;

    public KeChengXunXiAdapter(Context context, @Nullable List<KeChengXunXi> data) {
        super(R.layout.item_ke_cheng_xun_xi, data);
        this.mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, KeChengXunXi item) {

        TextView tv_zhuang_tai = helper.getView(R.id.tv_zhuang_tai);
        if (helper.getPosition() == 2) {
            tv_zhuang_tai.setBackgroundResource(R.drawable.icon_ke_cheng_xun_xi_zhuang_tai_2);
            tv_zhuang_tai.setText("已截止");
        } else {
            tv_zhuang_tai.setBackgroundResource(R.drawable.icon_ke_cheng_xun_xi_zhuang_tai_1);
            tv_zhuang_tai.setText("可報名");
        }
    }

}
